<!DOCTYPE html>
<!--2、求一组数中的所有数的和/平均值-->
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			var num=[12,415,62,6596,26526,2];
			document.write("数组："+num);
			var sum=0;
			for(var i=0;i<num.length;i++){
				sum=sum+num[i];
			}
			document.write("<br /><br />");
			document.write("和："+sum);
			var avg=sum/parseInt(num.length);
			document.write("<br /><br />");
			document.write("平均数："+avg);
		</script>
	</body>
</html>
